<%@include file="../controller/articles.jsp" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>EA IFI</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/style_article.css" rel="stylesheet" type="text/css" />
<link href="../css/layout.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="../js/cufon-yui.js" type="text/javascript"></script>
<script src="../js/cufon-replace.js" type="text/javascript"></script>
<script src="../js/Myriad_Pro_400.font.js" type="text/javascript"></script>
<script src="../js/Myriad_Pro_600.font.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/init.js"> </script>
<!--[if lt IE 7]>
<link href="css/ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
</head>
<body id="page3">
<!-- START PAGE SOURCE -->
<div id="header">
  <div class="container">
    <div class="logo"> <a href="#"><img src="../images/EAIFI.png" alt="" /></a> 
    <!--<span class="title"> Platefome d'&eacute;change d'articles</span> -->
    <a href="#"><img src="../images/title.png" alt="" /></a>
     <marquee><span class="title3">IFI--Institut Francophone Pour l'Informatique</span></marquee>
    </div>
    <!--
    <form action="#" id="search-form">
      <fieldset>
        <input type="text" class="text" />
        <input type="submit" value="Deconnecter" class="submit" />
      </fieldset>
    </form>
    -->
     <form action="#" id="search-form">
      <fieldset>
         < <span class="welcome"> <% out.print(String.format(" Bienvenu  ")); %> </span>
         
      </fieldset>
    </form>

    <ul class="nav">
      <li><a href="../echanges/index.jsp" ><span>Accueil</span></a></li>
      <li><a href="index.jsp" class="current"><span>Articles</span></a></li>
      
    </ul>
    <div class="extra-box">
      <div class="inner">
          <h2>EA IFI<span> aux services des &eacute;tudiants </span></h2>
        <ul>
            <li><a href="#">Valider &eacute;change</a></li>
          <li><a href="#">Modifier compte</a></li>
          <li><a href="deconnexion.jsp">Deconnexion</a></li>
         
        </ul>
        
      </div>
    </div>
   <div class="intro-text">
      <h1><span>Si vous pensez pour les autres,</span><em>les autres penseront pour vous! </em></h1>
      <p></p>
      <!--<div class="wrapper"><a href="#" class="button">View Our Works</a></div>-->
    </div>
  </div>
</div>
<div id="content">
  <div class="container">
    <div class="wrapper">
      <div class="aside">
        <div class="box">
          <h3>Article</h3>
        <% if(verif!=null) {out.println(verif); } %>
          <br/>
          <form action="" METHOD=POST ENCTYPE="multipart/form-data" id="login-form" name="article_form">
            <fieldset>
              <div class="descrip">
                  <label for="text">Description:</label>
                  <br/>
                  <TEXTAREA NAME="description" rows="6" id="description"></TEXTAREA>
              </div>
                <br/>
              <div class="upload">
                <label for="text">Image:</label>
<!--                <input type="text" class="image" name="text"/>-->
                 <input type="file" name="file" style=" width: -45px;" />
              
              </div>
                <br/>
                <div class="field">
                <label for="text">Categorie:</label>
<!--                <input type="text" class="text" name="text"/>-->
                <select id="categorieSelect" name="categorie" class="categText">
                    <% 
              CategorieService CatService = new CategorieService();
	  	List<Categorie> listAllCategories = new ArrayList<Categorie>();	
	        listAllCategories=CatService.findAllCategories();
                for (Categorie categorie : listAllCategories) {
                        out.println("<option value=\""+categorie.getIdCategorie()+"\" class=\"choix\">"+categorie.getLibelleCategorie()+"</option>");
		}
              %>

              </select>
              </div>
              <div class="wrapper">
                 
                <input type="submit" value="Valider" class="submit fleft" />
                <input type="reset" value="Vider" class="submit fright" />
                <input type="hidden" value="0" name="id_article" id="article_id"  />
                <input type="hidden" value="0" name="action_type" id="type_action"  />
                <input type="hidden" value="" name="boutton_maj" id="boutton_maj"  />
<!--                <div class="fright">
                  <input type="checkbox" name="checkbox" id="checkbox" />
                  <label for="checkbox">Remember</label>
                </div>-->
              </div>
            </fieldset>
          </form>
        </div>
      </div>
      <div class="mainContent">
        <h2>Liste des articles</h2>
        
             <% 
              ArticleService articleService = new ArticleService();
	  	List<Article> listAllArticle = new ArrayList<Article>();	
	        listAllArticle=articleService.findAllArticle(id_utilisateur);
                
                for (Article article : listAllArticle) {
                    String nomImag = "../data/"+article.getImg_article();
			%>
                        <table >
                        <tr >
                
                    <td style="vertical-align: top; width: 150px;"><img src="<%= nomImag%>" alt="" width="100px" height="100px"/></td>
                    <td style="vertical-align: top;width: 300px;"> <h4>Publi&eacute; le <%=article.getDate_create_article()%> </h4>
                        <%=article.getDescrip_article()%>
                     </td>
                <td style="vertical-align: top; width: 100px">
                    <div class="miseajour">
                        <input type="submit" value="Modifier" class="submit fright" onclick="initChp('<%=article.getDescrip_article()%>','<%=article.getId_categorie()%>','<%=article.getId_article()%>');" style="width: 100px;"/>
                    <br/><br/>
                    <%
                        //
                        String dispo = article.getEtat_article();
                        if(dispo.equalsIgnoreCase("Indisponible")) dispo = "Disponible";
                        else dispo = "Indisponible";
                    %>
                    <input type="submit" value="<%=dispo%>" class="submit fright"  onclick="changeEtatArticle('<%=article.getId_article() %>','<%=dispo%>');" style="width: 100px;"/>
                    
                  </div>
                </td>
            </tr>
                    <% 
                                CommentaireService commentaireService = new CommentaireService();
                                  List<Commentaire> listAllCommentaire = new ArrayList<Commentaire>();	
                                  listAllCommentaire=commentaireService.findAllCommentaire(article.getId_article());
                                  System.out.print("taille = "+listAllCommentaire.size());
                                  for (Commentaire commentaire : listAllCommentaire) {
                                      %>
                    <tr>
                        
                        <td style="vertical-align: top; width: 150px;">&nbsp;</td>
                        
                        <td style="vertical-align: top;width: 400px;" colspan="2"> 
                            <h4> <%=commentaire.getNom_utilisateur()%>:</h4>
                            <%=commentaire.getCommentaire()%>
                            <br>
                                <%=commentaire.getDate_commentaire()%>
                                      
                        </td>
                    </tr>
                    <%
                                  }
			%>
              </table> 
                      <br/>
                        <%
		}
              %>
<!--//            <tr>
//                <td hidden="">Identite</td>
//                <td style="vertical-align: top"><img src="../images/project_1.jpg" alt="" width="100px" height="100px"/></td>
//                <td> <h4>Nam libero tempore, cum soluta nobis est</h4>
//            Eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus emporibus autem quibusdam. </td>
//                <td>
//                    <div class="miseajour">
//                    <input type="submit" value="Modifier" class="submit fright" width="100"/>
//                    <br/><br/>
//                    <input type="submit" value="Indisponible" class="submit fright" />
//                    
//                  </div>
//                </td>
//            </tr>
//            <br/><br/><br/>
//            <tr>
//                <td hidden="">Identite</td>
//                <td><img src="../images/project_2.jpg" alt="" /></td>
//                <td> <h4>Nam libero tempore, cum soluta nobis est</h4>
//            Eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus emporibus autem quibusdam. </td>
//                <td>
//                    <div>
//                        <input type="submit" value="Modifier" class="submit fright" />
//                    <br/><br/>
//                    <input type="submit" value="Indisponible" class="submit fright" />
//                    
//                  </div>
//                </td>
//            </tr>-->
       
      </div>
    </div>
  </div>
</div>
<div id="footer">
  <div class="footerlink">
    <p class="lf">Copyright &copy; 2010 <a href="#">SiteName</a> - All Rights Reserved</p>
    <p class="rf"><a href="http://all-free-download.com/free-website-templates/">Free CSS Templates</a> by <a href="http://www.templatemonster.com/">TemplateMonster</a></p>
    <div style="clear:both;"></div>
  </div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
<!-- END PAGE SOURCE -->
<div align=center>This template  downloaded form <a href='http://all-free-download.com/free-website-templates/'>free website templates</a></div></body>
</html>